package cn.melon.view;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JLabel;

/**
 * @ClassName: JRollLabel
 * @author Hzy
 * 学籍页面字体专用，方便统一修改样式
 */
public class JRollLabel extends JLabel{
    public JRollLabel(String text){
        super(text);
//        this.setText(text);
        this.setForeground(new Color(86,78,90));
        this.setFont(new Font("微软雅黑",Font.PLAIN,16));
    }
    @Override
    public void paintComponent(Graphics g){
        Graphics2D g2d = (Graphics2D) g;
//      g2d设置
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);//开启抗锯齿
        g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);//渲染质量高
        g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);//关闭抖动
        g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);//画笔控制
        super.paintComponent(g2d);
        
    }
}
